]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
WindowDimmer: Don't try to use a ShaderEffect when GLSL is not available
authorAdel Gadllah <adel.gadllah@gmail.com>
Mon, 3 Oct 2011 16:11:59 +0000 (18:11 +0200)
committerAdel Gadllah <adel.gadllah@gmail.com>
Mon, 3 Oct 2011 16:22:47 +0000 (18:22 +0200)
This obviously won't work anyway but will just spam stderr with warnings,
so don't do it.

js/ui/windowManager.js

index 728b13327ba9e23537e2986219c300e34dc17abe..ab82c062937d5acc720a1e436bdc3c7efeeb6c76 100644 (file)
@@ -37,14 +37,23 @@ function WindowDimmer(actor) {
 
 WindowDimmer.prototype = {
     _init: function(actor) {
-        this.effect = new Clutter.ShaderEffect({ shader_type: Clutter.ShaderType.FRAGMENT_SHADER });
-        this.effect.set_shader_source(getDimShaderSource());
+        if (Clutter.feature_available(Clutter.FeatureFlags.SHADERS_GLSL)) {
+            this.effect = new Clutter.ShaderEffect({ shader_type: Clutter.ShaderType.FRAGMENT_SHADER });
+            this.effect.set_shader_source(getDimShaderSource());
+        }
+        else {
+            this._effect = null;
+        }
 
         this.actor = actor;
     },
 
     set dimFraction(fraction) {
         this._dimFraction = fraction;
+
+        if (this.effect == null)
+            return;
+
         if (!Meta.prefs_get_attach_modal_dialogs()) {
             this.effect.enabled = false;
             return;